﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Microsoft.Rtc.Collaboration.Samples.HTMLPresenceControls.Samples.Default" %>
<%@ Register TagPrefix="asp" Namespace="Microsoft.Rtc.Collaboration.Samples.HTMLPresenceControls.Controls" Assembly="Microsoft.Rtc.Collaboration.Samples.HTMLPresenceControls.Controls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>HTML Presence Controls - Samples Gallery</title>
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="site_wrapper">
        <div id="head">
            <img src="Images/ClarityLogo.png" alt="Clarity Consulting" />
        </div>
        <div id="content">
            <h1>
                PresenceIndicator ASP.NET Server Control</h1>
            <p>
                The <b>PresenceIndicator</b> control has several display modes. The default mode
                shows the presence indicator icon, the name of the contact that the control is bound
                to, and the text value of the availability, e.g. Available, Busy. The <b>ShowName</b>
                and <b>ShowStatus</b> properties can be set to toggle the display mode of the contact
                name and availability.
            </p>
            <div id="presence_wrapper">
                <asp:PresenceIndicator ID="pi1" SipAddress="sip:rl@fabrikam.com" runat="server" />
                <asp:PresenceIndicator ID="pi2" SipAddress="sip:rl@fabrikam.com" runat="server" ShowStatus="false" />
                <asp:PresenceIndicator ID="pi3" SipAddress="sip:rl@fabrikam.com" runat="server" ShowName="false" />
                <asp:PresenceIndicator ID="pi4" SipAddress="sip:rl@fabrikam.com" runat="server" ShowStatus="false" ShowName="false" />
            </div>
            <h1>
                PresenceIndicator ASP.NET Server Control in a GridView</h1>
            <p>
                The <b>PresenceIndicator</b> control can also be used various ASP.NET layout controls
                such as the GridView and Repeater. This allows you to use the control as part of
                a richer dataset, for example including the contact's title, list of accounts from
                a CRM system, etc.
            </p>
            <asp:GridView ID="gvAccounts" runat="server" AutoGenerateColumns="false">
                <Columns>
                    <asp:BoundField DataField="AccountName" HeaderText="Account Name" />
                    <asp:TemplateField HeaderText="Account Manager">
                        <ItemTemplate>
                            <asp:PresenceIndicator ID="presenceIndicator" runat="server" SipAddress='<%# Bind("AccountManagerSipUri") %>'
                                ShowStatus="false" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CustomerSince" HeaderText="Customer Since" DataFormatString="{0:d}" />
                    <asp:BoundField DataField="RevenueYTD" HeaderText="Revenue YTD" DataFormatString="{0:C}" />
                </Columns>
            </asp:GridView>
        </div>
    </div>
    </form>
</body>
</html>
